package de.dhbw.vs.permachat.client.activities.login;

import com.google.web.bindery.event.shared.Event;
import com.google.web.bindery.event.shared.EventBus;

public class LoggedInEvent extends Event<LoggedInEvent.Handler> {

	public interface Handler {
		void onLoggedIn(LoggedInEvent event);
	}

	private static final Type<LoggedInEvent.Handler> TYPE = new Type<LoggedInEvent.Handler>();

	public static void fire(EventBus eventBus) {
		eventBus.fireEvent(new LoggedInEvent());
	}

	@Override
	public com.google.web.bindery.event.shared.Event.Type<Handler> getAssociatedType() {
		return TYPE;
	}

	protected LoggedInEvent() {
	}

	@Override
	protected void dispatch(Handler handler) {
		handler.onLoggedIn(this);

	}

	public static Type<LoggedInEvent.Handler> getType() {
		return TYPE;
	}
}
